import request from "@/utils/request";

//获取页面0的数据
export const reqSpuList = (
  page: number,
  limit: number,
  c3ID: number | string
) => request.get(`/admin/product/${page}/${limit}?category3Id=${c3ID}`);

//修改页面要请求的数据 共4个

// 1.获取全部品牌的数据
export const reqTrademarkList = () =>
  request.get("/admin/product/baseTrademark/getTrademarkList");
// 2.获取全部销售属性
export const reqBaseSaleAttrList = () =>
  request.get("/admin/product/baseSaleAttrList");
// 3.获取某一个已有SPU照片墙的数据
export const reqSpuImageList = (spuId:number) =>
  request.get(`/admin/product/spuImageList/${spuId}`);
// 4 获取已有的SPU,已有的销售属性接口
export const reqSpuSaleAttrList = (spuId:number) =>
  request.get(`/admin/product/spuSaleAttrList/${spuId}`);

export const reqAddOrUpdataList = (data)=> {
    if(data.id){
      request.post('/admin/product/updateSpuInfo',data)
    }else{
      request.post('/admin/product/saveSpuInfo',data)
    }
}
//获取平台属性请求
export const reqAttrList = (c1id:string|number,c2id:string|number,c3id:string|number)=>{
  return request.get(`/admin/product/attrInfoList/${c1id}/${c2id}/${c3id}`)
}

//添加SKU
export const reqAddSku = (data:any)=>request.post('/admin/product/saveSkuInfo',data);
//查看的接口
export const reqSkuLisk = (skuId)=> request.get(`/admin/product/findBySpuId/${skuId}`)